<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>无标题文档</title>

	<script>

		window.onload = function () {
			var div1 = document.getElementById("div1");
			var div2 = document.getElementById("div2");
			var div3 = document.getElementById("div3");
			var div4 = document.getElementById("div4");
			div1arr = [];
			div2arr = [];
			div3arr = [];
			div4arr = [];
			var arr = [ '100px', 'abc'-6, [], -98765, 34, -2, 0, '300', , function(){alert(1);}, null, document, [], true, '200px'-30,'23.45元', 5, Number('abc'), function(){ alert(3); }, 'xyz'-90 ];
			fn();
			function fn(){
				for(var i = 0; i < arr.length; i++){
					if(typeof arr[i] === "number" && !isNaN(arr[i])){
						div1arr.push(arr[i]);
						div1.innerHTML = "找到arr里所有的数字：" + div1arr;
					}
					if(!isNaN(parseInt(arr[i]))){
						div2arr.push(arr[i]);
						div2.innerHTML = "找到可以转成数字的：" + div2arr;
						div3arr.push(parseInt(arr[i]));
						max = div3arr[0] ;
						for(var j = 0; j < div3arr.length; j++){
							if(max < div3arr[j]){
								max = div3arr[j];
							}
						}
						div3.innerHTML = "把转成数字以后，最大值判断出来：" + max;
					}
					if(isNaN(arr[i])){
						div4arr.push(i);
						div4.innerHTML = "把 NaN 所在的位置找出来：" + div4arr;
					}
				}

			}
		}
		/*
			1、找到arr里所有的数字：-98765, 34, -2, 0, 5
			2、找到可以转成数字的：'100px', -98765, 34, -2, 0, '300', '23.45元',  5
			3、把转成数字以后，最大值判断出来：300
			4、把 NaN 所在的位		置找出来：1 14 17  19
		*/
	</script>
</head>
<body>
	<div id="div1"></div>
	<div id="div2"></div>
	<div id="div3"></div>
	<div id="div4"></div>
</body>
</html>
